package org.esk.dablog.web.modules;

import org.esk.dablog.modules.Module;
import org.esk.dablog.service.EntryManager;
import org.esk.dablog.model.entries.Ride;
import org.esk.dablog.model.forum.ForumPostEntry;
import org.esk.dablog.web.elements.CalendarBean;

import javax.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Calendar;

/**
 * This class implements Calendar Module backend
 * User: esk
 * Date: Dec 3, 2006
 * Time: 6:09:35 PM
 * $Id:$
 */
public class ForumModule implements Module {
    public static final String FORUM_BEAN_PROPERTY = "__module__forum__bean";
    private EntryManager entryManager;


    public void initialize(String name, String prefix, HttpServletRequest request) {
        List posts = entryManager.listVisibleEntries(ForumPostEntry.class, 5);
        request.setAttribute(FORUM_BEAN_PROPERTY, posts);        
    }


    public void setEntryManager(EntryManager entryManager) {
        this.entryManager = entryManager;
    }
}
